package com.wangc.report.service.impl;

import com.wangc.report.dao.ConfigMapper;
import com.wangc.report.entity.ConfigEntity;
import com.wangc.report.service.ConfigService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Service实现类
 *
 * @author wangc
 * @email 1620415297@qq.com
 * @date 2020-10-20 14:13:37
 */
@Service("configService")
public class ConfigServiceImpl implements ConfigService {
    @Resource
    private ConfigMapper configMapper;

    @Override
    public ConfigEntity queryObject(Long id) {
        return configMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<ConfigEntity> queryList(Map<String, Object> map) {
        return configMapper.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return configMapper.queryTotal(map);
    }

    @Override
    public int save(ConfigEntity config) {
        return configMapper.insertSelective(config);
    }

    @Override
    public int update(ConfigEntity config) {
        return configMapper.updateByPrimaryKeySelective(config);
    }

    @Override
    public int delete(Long id) {
        return configMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int deleteBatch(Long[] ids) {
        return configMapper.deleteBatch(ids);
    }
}
